#include <stdio.h>

//内存交换两个数组内容
void MemChanges(void *arr1, void *arr2, int size) {
    char tmp = *(char *)arr1;
    *(char *)arr1 = *(char *)arr2;
    *(char *)arr2 = tmp;
    if (size > 1) {
        MemChanges(arr1 + 1, arr2 + 1, size - 1);
    }
}

int main() {
    int arr1[20] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
    int arr2[20] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
    MemChanges(arr1, arr2, 40);
    for (int i = 0; i < 10; i++) {
        printf("%d ", arr1[i]);
    }
    printf("\n");
    for (int i = 0; i < 10; i++) {
        printf("%d ", arr2[i]);
    }
    return 0;
}